<template>
  <div>
    <pre>
      {{ detailJSON }}
    </pre>
  </div>
</template>

<script>
import { getSource } from '@/api'
export default {
  props: {
    id: {
      type: String
    }
  },
  data () {
    return {
      detail: {}
    }
  },
  computed: {
    detailJSON () {
      return JSON.stringify(this.detail, null, '\t')
    }
  },
  created () {
    this.getDetail()
  },
  methods: {
    getDetail () {
      getSource({ _id: this.id }).then(res => {
        if (res.code === 200) {
          this.detail = res.data
        }
      })
    }
  }
}
</script>

<style>
</style>